//
//  SRDataBase.m
//  SportRing
//
//  Created by mykoma on 14-4-1.
//  Copyright (c) 2014年 HotOne. All rights reserved.
//

#import "SRDataBase.h"

#define DATA_BASE_NAME @"SportRing.sqlite"

@implementation SRDataBase

SHARED_INSTANCE_IMPLEMENT(SRDataBase);

-(void)setup
{
    [MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:DATA_BASE_NAME];
}

-(void)saveWithBlock:(void(^)(BOOL success, NSError *error))block
{
    [[NSManagedObjectContext MR_defaultContext] MR_saveToPersistentStoreWithCompletion:block];
}

-(void)cleanUp
{
    [MagicalRecord cleanUp];
}

@end
